using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICCreditDiscountMap : EntityTypeConfiguration<ICCreditDiscount>
    {
        public ICCreditDiscountMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FInterID, t.FCreditDays });

            // Properties
            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FCreditDays)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("ICCreditDiscount");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FCreditDays).HasColumnName("FCreditDays");
            this.Property(t => t.FDiscountRate).HasColumnName("FDiscountRate");
        }
    }
}
